﻿using System;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using System.Windows.Controls;
using System.Windows.Shapes;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Windows.Media.Animation;
using Bling.DSL;
using Bling.Properties;
using Bling.Animation;
using Bling.WPF;
using Bling.Shapes;
using Bling.Slides;
using Bling.Util;
using Bling.Linq;
using Bling.Lighting;
using Bling.Physics;

namespace Presentation {
  public class CodeA : Canvas {
    public CodeA() {
      CanvasBl Canvas = new CanvasBl(this) { CenterPosition = this.Bl().CenterSize };
      PointBl Size0 = new PointBl(0, 0);

      var l0b = new LabelBl(Canvas) {
        CenterTop = new PointBl(Canvas.CenterSize.X, Size0.Y),
        Font = { Size = 40d, Weight = FontWeights.SemiBold, Brush = Brushes.DarkOrange },
        Content = "Databinding via DLR Code Gen",
      };
      Size0 = Size0.Max(l0b.RightBottom);

      var l1 = new LabelBl(Canvas) {
        LeftTop = new PointBl(0, Size0.Y),
        Font = { Size = 40d, Weight = FontWeights.SemiBold, Brush = Brushes.DarkGreen },
        Content = "a. Walk tree looking for DP ref",
      };
      Size0 = Size0.Max(l1.RightBottom);
      l1.Font.Brush = l1.IsMouseOver.Condition(Brushes.Red, Brushes.DarkGreen);


      var l2 = new LabelBl(Canvas) {
        LeftTop = new PointBl(0, Size0.Y),
        Font = l1.Font,
        Content = "b. Populate MultiBinding object with DP binding",
      };
      l2.Font.Brush = l2.IsMouseOver.Condition(Brushes.Red, Brushes.DarkGreen);
      Size0 = Size0.Max(l2.RightBottom);
      
      var l4 = new LabelBl(Canvas) {
        LeftTop = new PointBl(0, Size0.Y),
        Font = l2.Font,
        Content = "c. Replace DP ref with indexed converter parameter",
      };
      l4.Font.Brush = l4.IsMouseOver.Condition(Brushes.Red, Brushes.DarkGreen);
      Size0 = Size0.Max(l4.RightBottom);

      var l5 = new LabelBl(Canvas) {
        LeftTop = new PointBl(0, Size0.Y),
        Font = l2.Font,
        Content = "d. Compile tree to body of converter",
      };
      l5.Font.Brush = l5.IsMouseOver.Condition(Brushes.Red, Brushes.DarkGreen);
      Size0 = Size0.Max(l5.RightBottom);

      Canvas.Size = Size0;
      Canvas.ScaleTo = this.Bl().Size - new PointBl(10, 10);
    }

  }
}
